<?php 

$user_mod= new Model_User();
$first_log = 1;

if(Zend_Auth::getInstance()->hasIdentity()){
	$login = Zend_Auth::getInstance()->getIdentity()->login;
	$us = $user_mod->getUserInfoByLogin($login);
	$first_log = $us->first_login;
}
?>

<?php
if (Zend_Auth::getInstance()->hasIdentity() &&  $first_log == 0) :
    ?>
<div style="float: left;"><a
	href="<?php
    echo $this->url(array('controller' => Zend_Auth::getInstance()->getIdentity()->login,"action" => null,'request' => null),"default")?>"><?php
    echo $this->translate("Main");
    ?></a>

<a
	href="<?php
    echo $this->url(array('controller' => 'preferences', 'action' => 'index','request' => null),"default")?>"><?php
    echo $this->translate("Preferences");
    ?></a>

<a 
	href="<?php
    echo $this->url(array('controller' => 'friend', 'action' => 'year','request' => "1000"),"default")?>"><?php
    echo $this->translate("Z-people");
    ?></a>
  
  <a 
	href="<?php
    echo $this->url(array('controller' => 'media', 'action' => 'audio','request' => null),"default")?>"><?php
    echo $this->translate("Media");
    ?></a>  
<a
	href="<?php
    echo $this->url(array('controller' => 'user', 'action' => 'logout','request' => null),"default")?>"><?php
    echo $this->translate("Logout");
    ?></a>
    
    <span style="padding-left: 20px"><?php echo Zend_Auth::getInstance()->getIdentity()->surname.' '.Zend_Auth::getInstance()->getIdentity()->name.' <b>('.Zend_Auth::getInstance()->getIdentity()->login.')</b>'?></span>
    
     <a
	href="<?php
    echo $this->url(array('controller' => "action", 'action' => null,'request' => null ),"default")?>"><?php
    echo $this->translate("News");
    ?></a>
    
    <a
	href="<?php
    echo $this->url(array('controller' => "friend", 'action' => "index",'request' => Zend_Auth::getInstance()->getIdentity()->login ),"default")?>"><?php
    echo $this->translate("Friends");
    ?></a>
    
     <a
	href="<?php
    echo $this->url(array('controller' => "guests", 'action' => "index",'request' => null ),"default")?>"><?php
    echo $this->translate("Guests");
    ?></a>
    
    <a
	href="<?php
    echo $this->url(array('controller' => "friend", 'action' => "online",'request' => null),"default")?>"><?php
    echo $this->translate("Online");
   
    ?></a>
    
     <a
	href="<?php
	 $friend_request = new Model_FriendRequest(Zend_Auth::getInstance()->getIdentity()->id);
    $reqests = $friend_request->getRequests()->count();
    
    echo $this->url(array('controller' => 'friend', 'action' => 'requestlist','request' => null),"default")?>"><?php
    if($reqests){
    	echo "(".$reqests.")";
    }
    ?></a>
    
  
     <a
	href="<?php
	 $message_model = new Model_Message();
    $unread_message = $message_model->getUnreadCount(Zend_Auth::getInstance()->getIdentity()->id);
    
    echo $this->url(array('controller' => 'message', 'action' => null,'request' => null),"default")?>"><?php
    if($unread_message){
        echo '<b style="color: red;" >'.$this->translate("Messages")."(".$unread_message.")".'</b>';
    }else{
        
        echo $this->translate("Messages")."(".$unread_message.")";
    }
    
    
    
    ?></a>
    
     <a style="font-weight: bold;"
	href="<?php
    echo $this->url(array('controller' => "message", 'action' => "feedback",'request' => null),"default")?>"><?php
    echo $this->translate("Feedback");
   
    ?></a>
    
    
</div>
<div style="float: right;">
	<form action="<?php echo Zend_Controller_Front::getInstance()->getBaseUrl().'/search/result' ?>" name="form_search" method="post" >
		<input type="text" name="q">
		<input type="submit" name="submit" value="<?php echo $this->translate("Find")?>"> 
	</form>
</div>
<div style="clear: both;"></div>

<hr>

<?php endif;?>
